package com.zzvcom.sms.entity;

import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Map;

public class AppLockMopedParam extends AppLocationMopedParam {
    private final String rfidNumber;

    public AppLockMopedParam(String appKey, String companyCode, String licensePlateNumber, String rfidPlateNumber, String vin, String rfidNumber, BigDecimal longitude, BigDecimal latitude, Long timestamp, String nonce) {
        super(appKey, companyCode, licensePlateNumber, rfidPlateNumber, vin, longitude, latitude, timestamp, nonce);
        // rfidNumber 可以为空, 空值不会参与加密。
        this.rfidNumber = rfidNumber;
    }

    @Override
    public Map<String, String> toMap() {
        Map<String, String> treeMap = super.toMap();
        if (StringUtils.isNotBlank(this.rfidNumber)) {
            treeMap.put("rfidNumber", this.rfidNumber);
        }
        return treeMap;
    }

}